<include file="Public/header" /> 

<!--主窗体-->
<div class="container app">
	<!--左侧菜单-->
	<include file="Public/sidebar" /> 
	<!--左侧菜单//-->
	
	<!-- mainCon -->
	<div id="mainCon" class="mainCon">
		<h4>提现申请</h4>
		<div class="bk10"></div>
		<div>
			<form class="form-inline">
				<div class="form-group form-group-sm">
					<label for="name">开户名：</label>
					<input type="text" class="form-control" id="name" name="name" placeholder="开户名或支付宝账号" value="<{$name}>">
				</div>
				
				<div class="form-group form-group-sm">
					<label for="paytype">支付方式：</label>
					<select id="paytype" name="paytype" class="form-control">
						<option value="">全部</option>
						<option value="1" <eq name="paytype" value="1"> selected="true" </eq> >银行卡</option>
						<option value="2" <eq name="paytype" value="2"> selected="true" </eq> >支付宝</option>
						<option value="3" <eq name="paytype" value="3"> selected="true" </eq> >微信零钱</option>
					</select>
				</div>
				
				<div class="form-group form-group-sm">
					<label for="status">状态：</label>
					<select id="status" name="status" class="form-control">
						<option value="">全部</option>
						<option value="0" <eq name="status" value="0"> selected="true" </eq> >申请中</option>
						<option value="1" <eq name="status" value="1"> selected="true" </eq> >已完成</option>
						<option value="-1" <eq name="status" value="-1"> selected="true" </eq> >已作废</option>
					</select>
				</div>
				
				<div class="bk10"></div>
				<div class="form-group form-group-sm">
					<label for="start_time">时间：</label>
					<input type="text" class="form-control laydate-icon" id="start_time" name="start_time" value="<{$start_time?($start_time|date='Y-m-d H:i:s',###):''}>">
					<span>-</span>
					<input type="text" class="form-control laydate-icon" id="end_time" name="end_time"  value="<{$end_time?($end_time|date='Y-m-d H:i:s',###):''}>">
				</div>

				<button type="submit" class="btn btn-default btn-sm">筛选</button>
			</form>
		</div>

		<div class="bk10"></div>
		<table class="table table-bordered table-hover">
			<tr>
				<th>编号</th>
				<th>开户名或支付宝账号</th>
				<th>会员名</th>
				<th>登录帐号</th>
				<th>金额</th>
				<th>支付方式</th>
				<th>状态</th>
				<th>时间</th>
				<th>操作</th>
			</tr>

			<empty name="list">
				<tr><td colspan="7" style="text-align:center;color:#999">～暂无数据～</td></tr>
			<else /> 

				<foreach name="list" item="vo">
					<tr>
						<td><{$vo['id']}></td>
						<td><{$vo['name']}></td>
						<td><{$vo['username']}></td>
						<td><{$vo['mobile']}></td>
						<td>
							<{$vo['money']}>
						</td>
						<td>
							<if condition="$vo['paytype'] eq 1">
								银行卡
							<elseif condition="$vo['paytype'] eq 2"/>
								支付宝
							<elseif condition="$vo['paytype'] eq 3"/>
								微信零钱
							</if>
						</td>
						<td>
							<if condition="$vo['status'] eq 0">
								<span style="color:#FFA530">申请中</span>
							<elseif condition="$vo['status'] eq 1"/>
								<span style="color:green">已完成</span>
							<elseif condition="$vo['status'] eq -1"/>
								<span style="color:red">作废</span>
							<else />
								<span style="color:#FFA530">申请中</span>
							</if>
						</td>
						<td><{$vo['createtime']|date="Y-m-d H:i",###}></td>
						<td><!--<{:U('Withdrawal/Withdrawal_Edit',array('id'=>$vo['id'],'k'=>7))}>-->
							<a href="javascript:void(0)" onclick="iframe('<{:U('Withdrawal/Withdrawal_Edit',array('id'=>$vo['id']))}>')">查看详细</a>
							<if condition="$vo['status'] neq 1 and $vo['status'] neq -1"><a href="javascript:void(0)" class="delAct" data-id="<{$vo['id']}>">作废</a></if>
						</td>
					</tr>
				</foreach>
			
			</empty>
			
		</table>
		
		<div class="pagebar">
			<{$pager}>
		</div>
		
	</div>
	<!-- mainCon// -->
	
</div>
<!--主窗体//-->

<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>
$(function(){

	var start = {
		elem: '#start_time',
		format: 'YYYY/MM/DD hh:mm',
		istime: true,
		istoday: false,
		choose: function(datas){
			 end.min = datas;
			 end.start = datas;
		}
	};
	var end = {
		elem: '#end_time',
		format: 'YYYY/MM/DD hh:mm',
		istime: true,
		istoday: false,
		choose: function(datas){
			start.max = datas;
		}
	};
	laydate(start);
	laydate(end);

	$(".delAct").click(function(){
		var that = this;
		layer.confirm('您是否确认删作废记录？作废后不可恢复！', {icon: 3, title:'提示'}, function(index){
			var itemid = $(that).attr("data-id");
			$.post("<{:U('Withdrawal/withdrawal_Invalid')}>",{id:itemid},function(r){
				if(r.error == 1){
					layer.close(index);
					layer.alert(r.errmsg,{icon: 2});
				}else{
					layer.alert(r.errmsg,{icon: 1},function(){
						window.location.reload();
					});					
				}
			});
		});
		return false;
	});
		
});
	//查看详情
	function iframe(url){
		layer.open({
			type: 2, 
			content: url,
			area: ['300px', '500px']
		}); 
	}
	
	
	
</script>

<include file="Public/footer" /> 